package com.fdb.smcts.core.job;

import com.fdb.smcts.core.cache.Cache;
import com.fdb.smcts.core.util.SpringContextUtils;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;

public class CacheRefreshJob implements Job {
    
    private static Logger logger = LoggerFactory.getLogger(CacheRefreshJob.class);
    
    private String cacheKey;

    public void execute() {
        logger.info("缓存："+ cacheKey +"刷新开始......");
        Cache cache = SpringContextUtils.getBean(Cache.CACHE_BEAN, Cache.class);
        cache.reload(cacheKey);
        logger.info("缓存："+ cacheKey +"刷新结束......");
    }

    public String getCacheKey() {
        return cacheKey;
    }

    public void setCacheKey(String cacheKey) {
        this.cacheKey = cacheKey;
    }

}
